import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        author: 'IEECAS',
        zoom:1
    },
    getters: {
        authorName: function (state) {
            return state.author;
        },
        getZoom:function (state) {
            return state.zoom
        },
    },
    mutations: {
        changeName: function (state, payload) {
            state.author = payload.author;
        },
        changeZoom: function (state, payload) {
            state.zoom = payload.zoom;
        },
    },
    actions: {
        actionChangeName: function (context, payload) {
            context.commit('changeName', payload);
        },
        actionChangeZoom: function (context, payload) {
            context.commit('changeZoom', payload);
        },
    }
})
